package com.glela.api.pay.alipay.component;

import java.io.UnsupportedEncodingException;
import java.util.Map;

import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipayEbppPdeductPayResponse;
import com.alipay.api.response.AlipayOpenAuthTokenAppQueryResponse;
import com.alipay.api.response.AlipayOpenAuthTokenAppResponse;
import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse;
import com.alipay.api.response.AlipayTradePayResponse;
import com.alipay.api.response.AlipayTradeQueryResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
import com.glela.api.model.AlipayAppKeyInfo;

/**
 *@author liujie
 *@2016年11月3日
 */
public interface Alipay {
	
	public static final String FORMAT="json";
	
	public static final String CHARSET="utf-8";
	
	public static final String SERVICE="mobile.securitypay.pay";
	
	public static final String REFUND_SERVICE="refund_fastpay_by_platform_pwd";
	
	public static final String STRMETHOD = "post";
	
	public static final String SIGN_TYPE="RSA";
	
	public static final String INPUT_CHARSET="utf-8";

	public AlipayOpenAuthTokenAppResponse getOpenAuthToken(AlipayAppKeyInfo alipayAppKeyInfo 
			,String code,String refreshToken) throws AlipayApiException;
	
	public AlipayOpenAuthTokenAppQueryResponse queryOpenAuthToken(AlipayAppKeyInfo alipayAppKeyInfo
			,String appAuthToken) throws AlipayApiException;
	
	public AlipayTradePayResponse aliTradePay(AlipayAppKeyInfo alipayAppKeyInfo,String code,String orderSn
			,Integer totalFee) throws AlipayApiException;
	
	public AlipayTradeRefundResponse alipayRefund(AlipayAppKeyInfo alipayAppKeyInfo, String outTradeNo
			, String tradeNo, Long refundAmount, String afterSaleSn) throws AlipayApiException;

	public Map<String, String> getOrderString(AlipayAppKeyInfo alipayAppKeyInfo, String orderSn, Integer totalFee) throws UnsupportedEncodingException;

	Map<String, String> getOrderString(AlipayAppKeyInfo alipayAppKeyInfo, String orderSn, String payNo, Integer totalFee) throws UnsupportedEncodingException;
	
	public Map<String,String> getOrderVipString(AlipayAppKeyInfo alipayAppKeyInfo,String orderSn
			,Integer totalFee) throws UnsupportedEncodingException;
	
	/*public Map<String,String> getRefundString(AlipayAppKeyInfo alipayAppKeyInfo,String orderSn
			,Integer totalFee, String payId) throws Exception;*/
	AlipayTradeQueryResponse alipayTradeQuery(AlipayAppKeyInfo alipayAppKeyInfo, String outTradeNo) throws AlipayApiException;
	
	public AlipayEbppPdeductPayResponse alipayEbppPdeductPay(AlipayAppKeyInfo alipayAppKeyInfo,String agreementId
			,String userId,String billKey,String orderSn,Integer totalFee,Integer fineAmount) throws AlipayApiException;
	AlipayTradeFastpayRefundQueryResponse alipayTradeFastpayRefundQuery(
			AlipayAppKeyInfo alipayAppKeyInfo, String outTradeNo,String outRequestNo)
			throws AlipayApiException;
}
